package com.css.service.impl;

import java.util.List;

import com.css.dao.ICustomerDAO;
import com.css.service.ICustomerService;
import com.css.vo.Customer;

public class CustomerService implements ICustomerService {

	private ICustomerDAO customerDAO;

	public void setCustomerDAO(ICustomerDAO customerDAO) {
		this.customerDAO = customerDAO;
	}

	@Override
	public void save(Customer customer) {
		customerDAO.save(customer);
	}

	@Override
	public void delete(Customer customer) {
		customerDAO.delete(customer);
	}

	@Override
	public void update(Customer customer) {
		customerDAO.update(customer);
	}

	@Override
	public Customer find(String customerName) {
		return customerDAO.find(customerName);
	}

	@Override
	public List<Customer> findAllCustomer() {
		List list = customerDAO.findAllCustomer();
		return list;
	}

	@Override
	public Customer findById(Integer id) {
		List<Customer> list = customerDAO.findById(id);
		Customer customer = list.get(0);
		return customer;
	}

}
